<?php
use yii\helpers\Url;
?>
<!--<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm">Small modal</button>-->
<script>
    $(function(){
        $('#myModal').modal('show');
    })

</script>
<script>
    var i = 3;
    var intervalid;
    intervalid = setInterval("fun()", 1000);
    function fun() {
        if (i == 0) {
            window.location.href = "<?php echo Url::toRoute($data['url']) ;?>";
            clearInterval(intervalid);
        }
        document.getElementById("mes").innerHTML = i;
        i--;
        }
</script>
<div class="modal fade" id="myModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">提示信息</h4>
            </div>
            <div class="modal-body">
                <?php
                    foreach ($data['message'] as $k=>$v){
                ?>
                <p><?php echo $v[0];?></p>
                <?php
                }
                ?>
               <span id="mes">3</span> 秒钟将自动跳转
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <!--<button type="button" class="btn btn-primary">Save changes</button>-->
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->